﻿<cfsilent>
	<cfscript>
		
		termId = event.getArg("TermID");
		academicYear = event.getArg("AcademicYear");
		academicTerm = event.getArg("AcademicTerm");
		
		changeType = event.getArg("T");

		studentId = event.getArg("STU");
		classId = event.getArg("CLSID");
		
		currentTab = event.getArg("TabID", "labCheckForm");
		
		passArgs = structNew();
		structInsert( passArgs, "T", changeType );
		structInsert( passArgs, "TID", termId );
		structInsert( passArgs, "STU", studentId );
		structInsert( passArgs, "CLSID", classId );
		
		sql = "SELECT a.sct_name
				FROM t_stuchange_type a 
				WHERE a.sct_code = :changeType ";
				
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="changeType", value=changeType, cfsqltype = "cf_sql_char");

		rs_operObj = queryObj.execute( sql=sql ).getResult();
		
		event.setArg("pageTitle", "学生学籍管理 - 学籍异动 - " & rs_operObj.sct_name & "向导");
		
		/* 学校信息 */
		
		sql = "SELECT a.sch_name 
					FROM t_school a ";
					
		queryObj = new Query( datasource=application.dnsSlave );

		rs_school = queryObj.execute( sql=sql ).getResult();
		
		/* 学生信息 */
	
		sql = "SELECT a.stu_id,a.stu_name
					FROM t_student a 
					WHERE a.stu_id = :studentId ";
					
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="studentId", value=studentId, cfsqltype = "cf_sql_varchar");

		rs_stu = queryObj.execute( sql=sql ).getResult();
		/* 学生所在行政班 */
		
		sql = "SELECT c.sbj_name,b.cls_name,
					   b.grade,c.schooling_length,
					   d.institute_name  
				FROM t_student a 
					 INNER JOIN t_class b ON b.cls_id = a.cls_id 
					 INNER JOIN t_subject c ON c.sbj_id = b.sbj_id 
					 INNER JOIN t_institute d ON d.institute_id = c.institute_id 
				WHERE a.stu_id = :studentId ";
					
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="studentId", value=studentId, cfsqltype = "cf_sql_varchar");

		rs_class = queryObj.execute( sql=sql ).getResult();
		
		/* 变更后信息 */
		
		sql = "SELECT c.sbj_name,b.cls_name,
					   b.grade, c.schooling_length
				FROM  
					t_class b 
					 INNER JOIN t_subject c ON c.sbj_id = b.sbj_id 
				WHERE b.cls_id = :classId "; 
		
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="classId", value=classId, cfsqltype = "cf_sql_varchar");

		rs_classNew = queryObj.execute( sql=sql ).getResult(); 
		
	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('studentStatusChange')#</cfoutput>"><i class="mrs img btnList"></i><span class="uiButtonText">学籍异动</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 card"></i>学籍异动向导 <cfoutput>#rs_operObj.sct_name#</cfoutput> 
				</h2>
			</div>
		</div>
	</div>
</div>

<!--- 加载导航菜单 --->
<!-- stepMenu-->
<cfoutput>#event.getArg("stepMenu")#</cfoutput>
<!--/stepMenu-->

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="findStudent">
				
				<div class="UItab">
					<div class="tabLables">
						<span <cfif currentTab eq "labCheckForm">class="active"</cfif> id="labCheckForm" tabTarget="CheckForm">学籍异动信息</span>
					</div>
				</div>
				<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
					
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
								
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					
					// -->
					//]]>
				</script>
				
				<div id="CheckForm" class="tabContent">
					
					<div class="noticeBlock">
						<h3>请确认学籍异动操作信息</h3>
						<hr/>
					</div>

					<div class="noticeBlock">
						<h3>变更前</h3>
						<hr/>
					</div>
					
					<table class="UItable withBorder">
						<tr>
							<td>学号</td>
							<td><span class="number"><cfoutput>#rs_stu.stu_id#</cfoutput></span></td>
							<td>姓名</td>
							<td><cfoutput>#rs_stu.stu_name#</cfoutput></td>
							<td>专业</td>
							<td><cfoutput>#rs_class.sbj_name#</cfoutput></td>
						</tr>
						<tr>
							<td>行政班</td>
							<td><cfoutput>#rs_class.cls_name#</cfoutput></td>
							<td>年级</td>
							<td><span class="number"><cfoutput>#rs_class.grade#</cfoutput></span></td>
							<td>预期毕业年份</td>
							<td><span class="number"><cfoutput>#int((rs_class.grade + rs_class.schooling_length))#</cfoutput></span></td>
						</tr>
					</table>
					
				
					<form id="formSign" onSubmit="javascript:return processVerfiyForm('formSign');" class="formWrapper Transparent" method="post" action="<cfoutput>#buildURL('statusChangeWizardModifyDO')#</cfoutput>">
						
						<input type="hidden" name="TermID" value="<cfoutput>#termId#</cfoutput>" />
						
						<input type="hidden" name="ClassID" value="<cfoutput>#classId#</cfoutput>" />
						<input type="hidden" name="StudentID" value="<cfoutput>#studentId#</cfoutput>" />
						<input type="hidden" name="ChangeTypeCode" value="<cfoutput>#changeType#</cfoutput>" />
						
						<input type="hidden" name="Source" value="<cfoutput>#rs_school.sch_name#</cfoutput>" />
						<input type="hidden" name="Target" value="<cfoutput>#rs_school.sch_name#</cfoutput>" />
						<input type="hidden" name="Description" value="<cfoutput>#rs_operObj.sct_name#</cfoutput>" />
						
						<!--- 原学籍信息 --->
						<input type="hidden" name="FormClass" value="<cfoutput>#rs_class.cls_name#</cfoutput>" />
						<input type="hidden" name="Grade" value="<cfoutput>#rs_class.grade#</cfoutput>" />
						<input type="hidden" name="Subject" value="<cfoutput>#rs_class.sbj_name#</cfoutput>" />
						<input type="hidden" name="Institute" value="<cfoutput>#rs_class.institute_name#</cfoutput>" />
						
						<hr/>
						
						<div class="label">
							<b>审批文号</b>
							<input name="ApproveDocument" id="ApproveDocument" type="text" class="typeText typeTextShort" maxlength="24" value="" />
						</div>
						
						<div class="label">
							<span class="req">*</span><b>审批日期</b>
							<input name="ApproveDate" id="ApproveDate" type="text" class="typeDate" verification="date" maxlength="10" value="<cfoutput>#dateFormat(now(), 'YYYY-MM-DD')#</cfoutput>" /><span id="dateTrigger" class="btnCalendar"></span>
						</div>
						
						<div class="lable">
							<input class="button" type="submit" value="执行异动" />
						</div>
						
					</form>
					<script language="javascript" type="text/javascript">
						//<![CDATA[
						<!--
						$(document).ready(function() {
						
							$("#ApproveDate").mask("9999-99-99");
							
							Calendar.setup({
									trigger    : "dateTrigger",
									inputField : "ApproveDate",
									animation  : false
									});
									
						});
						// -->
						//]]>
					</script>
					
				</div>
				
			</div>
		</li>
	</ul>
</div>